package org.xserver.component.exception;

public class RequestTypeException extends AbstractServerError {
	public enum RequestTypeExceptionEnum {
		NOT_SUPPORTED_PROTOTYPE("00000001", "不支持的协议类型"),
		NEED_HTTP("00000002", "需要通过http协议调用"),
		NEED_HTTPS("00000003", "需要通过HTTPS协议调用");

		RequestTypeExceptionEnum(String code, String message) {
			this.code = code;
			this.message = message;
		}

		private String code;
		private String message;

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getMessage() {
			return message;
		}

		public void setMessage(String message) {
			this.message = message;
		}
	}

	public RequestTypeException(String errorCode, String message) {
		super(errorCode, message);
	}

	public RequestTypeException(RequestTypeExceptionEnum requestTypeExceptionEnum) {
		super(requestTypeExceptionEnum.getCode(), requestTypeExceptionEnum.getMessage());
	}
}
